﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebClasses.Pages;
using DomainModel;

public partial class Admin_ProductCenter_OrderManage : NormalPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            QueryOrders();
        }
    }

    private void QueryOrders()
    {
        IEnumerable<Order> orderList = this.LogicController.ProductManager.GetAllOrders();
        rptOrder.DataSource = orderList;
        rptOrder.DataBind();
    }

    protected void rptProduct_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            this.LogicController.ProductManager.DeleteOrderByID(Convert.ToInt32(e.CommandArgument));
            QueryOrders();
        }
    }
}
